package com.jiaai.web.zfp_back.anchor;

import com.alibaba.dubbo.config.annotation.Reference;
import com.jiaai.hot.api.HotApi;
import com.jiaai.util.RestResultGenerator;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * class_name:ZBAnchorController
 * describe:TODO
 * create_user:张昉平
 * create_date:2017/12/19
 * create_date:10:50
 */
@RestController
@RequestMapping("/api/v1/admin/hot")
public class ZBHotController {

    @Reference
    private HotApi hotApi;


    @PostMapping("/addhot")
    public Object addhot(@RequestParam String anchorId,Integer id) throws Exception{
            hotApi.addHot(anchorId,id);
            return RestResultGenerator.genSuccessResult("推荐成功");
    }
    @PostMapping("/changeHot")
    public Object changeHot(@RequestParam String anchorId,@RequestParam Integer id) throws Exception{
            hotApi.changeHot(anchorId,id);
            return RestResultGenerator.genSuccessResult("下架成功");
    }
}
